//
//  JXChatManager.h
//  JiaoX
//
//  Created by yinqy on 15/3/12.
//  Copyright (c) 2015年 北京娇羞科技有限公司. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "JXMessage.h"
#import "ChatMsgDao.h"
#import "UserInfoDao.h"

/**
 *  消息更新type
 */
typedef NS_ENUM(NSInteger, MsgUpdateType){
    /**
     *  是我发送成功之后，通知更新
     */
    MsgUpdateTypeSend = 0,
    /**
     *  是我接收到消息，通知更新
     */
    MsgUpdateTypeReceive = 1
};

@protocol JXChatManagerDelegate <NSObject>

@optional
-(void)messageUpdate:(JXMessage *)message msgUpdateType:(MsgUpdateType)type;
@end

@interface JXChatManager : NSObject

@property (nonatomic, strong)UserInfoDao *userInfoDao;
@property (nonatomic, strong)ChatMsgDao *chatMsgDao;
@property (nonatomic, weak) id<JXChatManagerDelegate> delegate;

+ (instancetype)sharedInstance;
-(void)openSession;
/**
 *  发送文本消息
 *
 *  @param toPeerId   发送给谁
 *  @param messageStr 发送的内容
 */
-(JXMessage *)sendMessageToPeerId:(NSString *)toPeerId messageStr:(NSString *)messageStr;
/**
 *  根据相关参数获取图片的消息
 *
 *  @param objectId 消息id
 *  @param imgFile  图片内容
 *  @param toPeerId 发送给谁
 *
 *  @return
 */
-(JXMessage *)imgMsgWithObjectId:(NSString *)objectId imgFile:(NSString *)imgFile toPeerId:(NSString *)toPeerId imgW:(CGFloat)imgW imgH:(CGFloat)imgH;
-(void)getSignAndOpenSession;
-(void)unWatchWithPeerId:(NSString *)toPeerId;
@end
